1. Field of the Invention
The invention relates generally to credit-based flow control and more specifically relates to processing packets in a credit-based flow control scheme.
2. Discussion of Related Art
To manage the flow of data between a transmitter and a receiver, a flow control scheme is typically used to prevent the transmitter from transmitting additional data to the receiver when the receiver is not able to receive the additional data. In one flow control scheme, the receiver issues credits against which the transmitter may transmit data to the receiver. The transmitter may not transmit data to the receiver if doing so would consume more than the available credit. As the receiver becomes able to receive additional data, the receiver issues additional credits to the transmitter.
One exemplary credit-based flow control scheme is used by the Peripheral Component Interconnect (“PCI”) Express standard. In this scheme, a data transmission is associated with a credit type for flow control purposes. There are six flow control credit types: posted request header, posted request data, non-posted request header, non-posted request data, completion header, and completion data. A receiving device initially advertises credits available for each flow control credit type. When a transmitting device transmits packets of a particular credit type to the receiving device, the transmitting device uses up credits of the particular credit type. After the receiving device finishes processing the packets, the receiving device signals the transmitting device to restore the available credit.
A PCI Express device can comprise multiple entities and their corresponding one or more functions. Each function (or entity) can initiate a request at the PCI Express Application Layer that results in the transmission of multiple packets (that also uses up credits of the corresponding credit type). Although multiple packets may be generated in a request, the PCI Express device begins to transmit packets even if there are not enough credits to complete the processing of the request.
The PCI Express device verifies that there is sufficient credit available before transmitting each packet. If sufficient credit is not available to transmit a packet, processing of the request is blocked. However, this causes processing of a second request to be stalled even if the second request would use a second credit type that is available, and the PCI Express device would thus be able to transmit packets generated from the second request. Stalling the processing of the second request leads to degraded performance of the PCI Express device just as maintaining high performance of the PCI Express device is becoming more critical in today's demanding data processing applications.
Thus it is an ongoing challenge to maintaining high performance of the PCI Express device through improved processing of packets in a credit-based flow control scheme.